package cn.source.report.controller;

import cn.source.common.core.domain.AjaxResult;
import cn.source.report.entity.ReportParams;
import cn.source.report.service.DbVoltageHarmonicsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/report")
public class VoltageHarmonicsController {

    @Autowired
    private DbVoltageHarmonicsService dbVoltageHarmonicsService;

    @GetMapping("/voltage")
    public AjaxResult voltage(ReportParams reportParams) {
        List<Map<String, Object>> list = dbVoltageHarmonicsService.selectVoltageHarmonics(reportParams);

        return AjaxResult.success(list);
    }

    @GetMapping("/electricCurrent")
    public AjaxResult electric(ReportParams reportParams) {
        List<Map<String, Object>> list = dbVoltageHarmonicsService.selectElectricHarmonics(reportParams);

        return AjaxResult.success(list);
    }


    @GetMapping("/dataBase")
    public AjaxResult dataBase(ReportParams reportParams){
        List<Map<String, Object>> list = dbVoltageHarmonicsService.selectDataBase(reportParams);
        return AjaxResult.success(list);
    }

}
